using System;
using System.Linq.Expressions;

namespace MathService.Expressions.Complex
{
    public class ComplexLambdaUnaryExpression : ComplexUnaryExpression
    {
        private readonly Func<ComplexExpression, Expression> f_GetRe;
        private readonly Func<ComplexExpression, Expression> f_GetIm;

        public ComplexLambdaUnaryExpression(ComplexExpression Value,
                    Func<ComplexExpression, Expression> GetRe, Func<ComplexExpression, Expression> GetIm)
                    : base(Value)
        {
            f_GetRe = GetRe;
            f_GetIm = GetIm;
        }

        protected override Expression GetRe() { return f_GetRe(Value); }

        protected override Expression GetIm() { return f_GetIm(Value); }
    }
}